<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div class="box">
        <div class="box1">快乐就完事了
            <div class="box2"></div>
            <p class="p2">嘻嘻</p>
        </div>
        <button class="btn">点我点我</button>
    </div>

    <script src="../js/jquery.js"></script>

    <script>
        console.log(($(".p2").parent()).text())
        $(".btn").prev().css({
            background: "#843452"
        })
    </script>
</body>

</html>